<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title></title>
    <%--<link rel="stylesheet" href="/css/base/base.css?20201106.1">--%>
    <link rel="stylesheet" href="/lib/layer/skin/default/layer.css">
    <script src="/lib/layer/layer.js?20201106"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script src="/js/base/base.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/lay/dest/layui.all.js"></script>
    <style>
        .experts_block_content_info {
            width: 480px;
            height: 68px;
            float: left;
            font-size: 13px;
            margin-top: 15px;
            margin-left: 1%;
            line-height: 25px;
        }
        .experts_block_content_infos {
                 width: 480px;
                 height: 68px;
                 float: left;
                 font-size: 13px;
                 margin-top: 15px;
                 margin-left: 3%;
                 line-height: 25px;
             }


        .img-rounded {
            -webkit-border-radius: 6px;
            -moz-border-radius: 6px;
            border-radius: 6px;
        }

        .img-polaroid {
            padding: 4px;
            background-color: #fff;
            border: 1px solid #ccc;
            border: 1px solid rgba(0, 0, 0, 0.2);
            -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        li {
            margin-left: 120px;
            margin-top: 7px;
            list-style: none;
        }
        .experts_block, .experts_block_img {
            width: 400px;
            float: left;
            margin-left: 1%;
            margin-top: 1%;
        }

        .experts_block_image {
            width: 400px;
            float: left;
            margin-left: 3%;
            margin-top: 1%;
        }

        div {
            display: block;
        }

        body {
            margin: 0;
            font-family: Simsun, Arial, sans-serif;
            font-size: 13px;
            line-height: 20px;
            color: #333333;
            background-color: #ffffff;
        }

        body, button, input, select, textarea {
            color: #393939;
        }

        .btn-info {
            border: 1px solid #46b8da;
            color: #ffffff;
            background-color: #5bc0de;
            background-image: -moz-linear-gradient(top, #5bc0de, #5bc0de);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#5bc0de));
            background-image: -webkit-linear-gradient(top, #5bc0de, #5bc0de);
            background-image: -o-linear-gradient(top, #5bc0de, #5bc0de);
            background-image: linear-gradient(to bottom, #5bc0de, #5bc0de);
            background-repeat: repeat-x;
        }

        .btn-small {
            position: relative;
            top: -8px;
            padding: 5px 9px;
            font-size: 12px;
            line-height: 15px;
            border-radius: 6px;
        }

        .detailUl{
            margin-left: 10px;
        }
        .detailUl2{
            margin-left: 50px;
        }
    </style>
</head>
<body>
<div id="main">

</div>
<%--<div id="email">

</div>--%>
<script>
    var arr;
    var str = '';

    $.post('/hr/api/getExperInformationList',function(json){
        if(json.flag){
            arr=json.object;
            if(arr.length>0) {
                for(var i =0; i < arr.length; i ++) {
                    str +='<div class="experts_block">'+
                        '<div class="experts_block_img">'+
                        '<span style="float:left;width:140px;height: 140px;"><a role="button" data-toggle="modal" href="#edit_add" info="75" class="edit_add_href" title="查看个人信息"><img src="'+function () {
                            if (arr[i].photoName == ''){
                                return '<%=basePath%>img/hr/expertInformation_photo.png';
                            } else {
                                return '<%=basePath%>img//hr'+arr[i].photoName;
                            }

                        }()+'" class="img-rounded img-polaroid" width="140" height="140" style="width:140px;height: 140px;"></a></span>'+
                        '   <span class="experts_block_content">'+
                        '<ul class="detailUl">'+
                        '  <li>姓名：'+arr[i].staffName+' </li>'+
                        '  <li>部门：'+arr[i].deptName+'</li>'+
                        '<li>职称：'+ function () {
                            if(arr[i].presentPosition == '02') {
                                return '<fmt:message code="hr.th.AssistantEngineer" />';
                            }else if(arr[i].presentPosition == '08') {
                                return '<fmt:message code="hr.th.SeniorTitles" />';
                            }else if(arr[i].presentPosition == '01') {
                                return '<fmt:message code="hr.th.Engineer" />';
                            }else if(arr[i].presentPosition == '03') {
                                return '<fmt:message code="hr.th.SeniorEngineer" />';
                            }else if(arr[i].presentPosition == '04') {
                                return '<fmt:message code="hr.th.Senior" />';
                            }else if(arr[i].presentPosition == '07') {
                                return '<fmt:message code="hr.th.Title" />';
                            }else if(arr[i].presentPosition == '') {
                                return ' ';
                            }

                        }()+'</li>'+
                        '<li style=" width: 190px; height: 29px;">'+
                        '<img staffName="'+arr[i].staffName+'" userId="'+arr[i].userId+'" class="send_email" src="../img/hr/expertInformation_sendEmail.png" style="margin-right:10px;cursor:pointer;" title="发送邮件">'+
                        '<a href="#edit_add" role="button" data-toggle="modal" info="75" title="详情" class="btn btn-info btn-small edit_add_href" style=" color: white;cursor:pointer;margin-top: 10px;" userId="'+arr[i].userId+'">详情</a>'+
                        ' </li>'+
                        '</ul>'+
                        '</span>'+
                        '</div>'+
                        '<div class="experts_block_content_info">'+
                        '<div><span class="experts_block_content_info_left">研究领域：'+arr[i].researchResults+'</span></div>'+
                        '</div>'+
                        '</div>';
                }
            }else{
                 str += '<img style="display: block;text-align: center;margin: 0 auto;margin-top: 160px;margin-bottom: 10px;" src="/img/main_img/shouyekong.png" alt="">'+
                    '<h2 style="text-align: center;color: #666;font-size: 11pt;">暂无数据</h2>';
            }
            $('#main').html(str);
        }
    },'json')

    $(document).on('click','.edit_add_href',function () {
        var userId = $(this).attr("userId");
        $.post('/hr/api/selectStaffInfoByIds',{userId:userId},function(json){
            if(json.flag){
                arr=json.object;
                layer.open({
                    type: 1,
                    title:['专家详情', 'background-color:#2b7fe0;color:#fff;'],
                    area: ['50%', '80%'],
                    shadeClose: true, //点击遮罩关闭
                    btn: ['关闭'],
                    content:'<div class="experts_block">'+
                    '<div class="experts_block_image">'+
                    '        <span style="float:left;width:180px;height: 180px;"><a role="button" data-toggle="modal" href="#edit_add" info="75" class="edit_add_href" title="查看个人信息"><img src="'+function () {
                        if (arr.photoName == ''){
                            return '<%=basePath%>img/hr/expertInformation_photo.png';
                        } else {
                            return '<%=basePath%>img/hr/'+arr.photoName;
                        }

                    }()+'" class="img-rounded img-polaroid" width="140" height="140" style="width:180px;height: 180px;"></a></span>'+
                    '   <span class="experts_block_content">'+
                    '<ul class="detailUl2">'+
                    '  <li>姓名：'+arr.staffName+' </li>'+
                    '  <li>部门：'+arr.deptName+'</li>'+
                    '<li>职称：'+ function () {
                        if(arr.presentPosition == '02') {
                            return '<fmt:message code="hr.th.AssistantEngineer" />';
                        }else if(arr.presentPosition == '08') {
                            return '<fmt:message code="hr.th.SeniorTitles" />';
                        }else if(arr.presentPosition == '01') {
                            return '<fmt:message code="hr.th.Engineer" />';
                        }else if(arr.presentPosition == '03') {
                            return '<fmt:message code="hr.th.SeniorEngineer" />';
                        }else if(arr.presentPosition == '04') {
                            return '<fmt:message code="hr.th.Senior" />';
                        }else if(arr.presentPosition == '07') {
                            return '<fmt:message code="hr.th.Title" />';
                        }else if(arr.presentPosition == '') {
                            return ' ';
                        }

                    }()+'</li>'+
                    '<li>手机：'+arr.staffMobile+'</li>'+
                    '<li>电话：'+arr.staffPhone+'</li>'+
                    '<li style=" width: 190px; height: 29px;">'+
                    '<img staffName="'+arr.staffName+'" userId="'+arr.userId+'" class="send_email" src="../img/hr/expertInformation_sendEmail.png" style="margin-right:10px;cursor:pointer;" title="发送邮件">'+
                    ' </li>'+
                    '</ul>'+
                    '</span>'+
                    '</div>'+
                    '<div class="experts_block_content_infos">'+
                    '<div><span class="experts_block_content_info_left">研究领域：'+arr.researchResults+'</span></div>'+
                    '<div><span class="experts_block_content_info_left">成果介绍：'+arr.researchResults+'</span></div>'+
                    '<div><span class="experts_block_content_info_left">社会兼职：'+arr.partTime+'</span></div>'+
                    '<div><span class="experts_block_content_info_left">个人简历：'+arr.resume+'</span></div>'+
                    '</div>'+
                    '</div>'
                    ,
                    success:function(){

                    },
                    btn1:function(index){
                        layer.close(index);
                    }
                })
            }
        },'json')

    })

    $(document).on('click','.send_email',function () {
        var userId = $(this).attr('userId');
        var staffName = $(this).attr('staffName');
        $.popWindow("/hr/email?userId="+userId+ '&userName='+staffName,'写邮件','0','0','1200px','600px');
    })
</script>
</body>
</html>